USE [EmployeeInfo]
GO

/****** Object:  Table [dbo].[WorkFlow]    Script Date: 5/13/2016 10:42:48 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO
 
CREATE TABLE [dbo].[WorkFlow](
	[flow_id] [int] NOT NULL,
	[flowStatus] [nvarchar](50) NULL,
PRIMARY KEY CLUSTERED 
(
	[flow_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

/****** Object:  Table [dbo].[EmpRole]    Script Date: 5/13/2016 3:00:33 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[EmpRole](
	[role_id] [int] IDENTITY(1,1) NOT NULL,
	[emp_role] [nchar](10) NULL,
PRIMARY KEY CLUSTERED 
(
	[role_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO




/****** Object:  Table [dbo].[Employee]    Script Date: 5/13/2016 3:04:30 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Employee](
	[emp_id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NULL,
	[taskInProgress] [nvarchar](50) NULL,
	[role_id] [int] NULL,
PRIMARY KEY CLUSTERED 
(
	[emp_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[Employee]  WITH CHECK ADD FOREIGN KEY([role_id])
REFERENCES [dbo].[EmpRole] ([role_id])
GO




/****** Object:  Table [dbo].[TaskTable]    Script Date: 5/13/2016 10:42:42 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE TABLE [dbo].[TaskTable] (
    [task_id]          INT            IDENTITY (1, 1) NOT NULL,
    [task_name]        NVARCHAR (50)  NULL,
    [task_description] NVARCHAR (MAX) NULL,
    [date]             DATETIME     NULL,
    [flow_id]          INT            NOT NULL,
	[emp_id]          INT            NOT NULL,
 
PRIMARY KEY CLUSTERED 
(
	[task_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

ALTER TABLE [dbo].[TaskTable]  WITH CHECK ADD FOREIGN KEY([flow_id])
REFERENCES [dbo].[WorkFlow] ([flow_id])
GO


/****** Object:  Table [dbo].[Emp_Task]    Script Date: 5/13/2016 10:42:29 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE TABLE [dbo].[Emp_Task](
	[emptask_id] [int] IDENTITY(1,1) NOT NULL,
	[emp_id] [int] NOT NULL,
	[task_id] [int] NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[emptask_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[Emp_Task]  WITH CHECK ADD FOREIGN KEY([emp_id])
REFERENCES [dbo].[Employee] ([emp_id])
GO

ALTER TABLE [dbo].[Emp_Task]  WITH CHECK ADD FOREIGN KEY([task_id])
REFERENCES [dbo].[TaskTable] ([task_id])
GO


INSERT INTO [dbo].[WorkFlow] ([flow_id], [flowStatus]) VALUES (1, N'Designing ')
INSERT INTO [dbo].[WorkFlow] ([flow_id], [flowStatus]) VALUES (2, N'Verify Design')
INSERT INTO [dbo].[WorkFlow] ([flow_id], [flowStatus]) VALUES (3, N'Batch Edit and CSV')
INSERT INTO [dbo].[WorkFlow] ([flow_id], [flowStatus]) VALUES (4, N'Verify CSV')
INSERT INTO [dbo].[WorkFlow] ([flow_id], [flowStatus]) VALUES (5, N'Upload')
INSERT INTO [dbo].[WorkFlow] ([flow_id], [flowStatus]) VALUES (6, N'Final Process')


SET IDENTITY_INSERT [dbo].[TaskTable] ON
INSERT INTO [dbo].[TaskTable] ([task_id], [task_name], [task_description], [flow_id]) VALUES (5, N'Rugby Designs', N'Create Design for Rugby', 3)
INSERT INTO [dbo].[TaskTable] ([task_id], [task_name], [task_description], [flow_id]) VALUES (6, N'Tennise Designs', N'Create Designs for Tennis', 1)
SET IDENTITY_INSERT [dbo].[TaskTable] OFF


SET IDENTITY_INSERT [dbo].[Employee] ON
INSERT INTO [dbo].[Employee] ([emp_id], [Name], [taskInProgress], [role_id]) VALUES (1, N'Janine Francesca C. Pring
', N'Janine', 2)
INSERT INTO [dbo].[Employee] ([emp_id], [Name], [taskInProgress], [role_id]) VALUES (2, N'Mylene Emraida U. Delis
', N'Mylene', 2)
INSERT INTO [dbo].[Employee] ([emp_id], [Name], [taskInProgress], [role_id]) VALUES (5, N'Manuel John Pabilona
', N'MJ', 2)
INSERT INTO [dbo].[Employee] ([emp_id], [Name], [taskInProgress], [role_id]) VALUES (6, N'Arielle Jazmine Roque
', N'Arielle', 2)
INSERT INTO [dbo].[Employee] ([emp_id], [Name], [taskInProgress], [role_id]) VALUES (8, N'Jhan Jhay Laping
', N'Janry', 3)
INSERT INTO [dbo].[Employee] ([emp_id], [Name], [taskInProgress], [role_id]) VALUES (9, N'Weleen Latigo
', N'Weleen', 2)
INSERT INTO [dbo].[Employee] ([emp_id], [Name], [taskInProgress], [role_id]) VALUES (11, N'Muhaymin Delis
', N'Macky', 2)
INSERT INTO [dbo].[Employee] ([emp_id], [Name], [taskInProgress], [role_id]) VALUES (12, N'Ma.Nica Quiambao
', N'Nica', 2)
INSERT INTO [dbo].[Employee] ([emp_id], [Name], [taskInProgress], [role_id]) VALUES (15, N'Arro Maysael Wenceslao
', N'Arro Maysael', 1)
INSERT INTO [dbo].[Employee] ([emp_id], [Name], [taskInProgress], [role_id]) VALUES (16, N'Angelbert Eumag
', N'Angel', 2)
INSERT INTO [dbo].[Employee] ([emp_id], [Name], [taskInProgress], [role_id]) VALUES (17, N'Kathleen Sucayan
', N'Katkat', 1)
INSERT INTO [dbo].[Employee] ([emp_id], [Name], [taskInProgress], [role_id]) VALUES (18, N'Deo Federick Duran
', N'Deo', 1)
INSERT INTO [dbo].[Employee] ([emp_id], [Name], [taskInProgress], [role_id]) VALUES (20, N'Eigne James Duco
', N'Jay', 2)
INSERT INTO [dbo].[Employee] ([emp_id], [Name], [taskInProgress], [role_id]) VALUES (21, N'Justin Angelo C. Pedregosa
', N'Jap', 2)
SET IDENTITY_INSERT [dbo].[Employee] OFF

SET IDENTITY_INSERT [dbo].[Emp_Task] ON
INSERT INTO [dbo].[Emp_Task] ([emptask_id], [emp_id], [task_id]) VALUES (1, 8, 5)
INSERT INTO [dbo].[Emp_Task] ([emptask_id], [emp_id], [task_id]) VALUES (2, 9, 6)
SET IDENTITY_INSERT [dbo].[Emp_Task] OFF

SET IDENTITY_INSERT [dbo].[EmpRole] ON
INSERT INTO [dbo].[EmpRole] ([role_id], [emp_role]) VALUES (1, N'Uploader')
INSERT INTO [dbo].[EmpRole] ([role_id], [emp_role]) VALUES (2, N'Designer')
INSERT INTO [dbo].[EmpRole] ([role_id], [emp_role]) VALUES (3, N'Verifier')
SET IDENTITY_INSERT [dbo].[EmpRole] OFF

